import http from "@/api";
import { ResPage } from "@/api/interface";
import {
ApiAccountConfigCreate,
ApiAccountConfigDelete,
ApiAccountConfigSearch,
ApiAccountConfigUpdate,
ApiAccountConfigExport,
ApiAccountConfigImport,
ApiAccountConfigImportTemplateFile,
} from "@/api/apis/account_config";
import { ReqSearch } from "@/api/interface/Search/ReqSearch";
import { dtoAccountConfigCreate, dtoAccountConfigDelete, dtoAccountConfigInfo, dtoAccountConfigUpdate } from "@/api/dbdto/dtoAccountConfig";

export const requestAccountConfigCreate = (params: dtoAccountConfigCreate) => {
return http.post(ApiAccountConfigCreate, params);
};

export const requestAccountConfigSearch = (params: ReqSearch) => {
return http.post<ResPage<dtoAccountConfigInfo>>(ApiAccountConfigSearch, params);
};

export const requestAccountConfigUpdate = (params: dtoAccountConfigUpdate) => {
return http.post(ApiAccountConfigUpdate, params);
};

export const requestAccountConfigDelete = (params: dtoAccountConfigDelete) => {
return http.post(ApiAccountConfigDelete, params);
};

//导入数据
export const requestAccountConfigImport = (params: FormData) => {
return http.post(ApiAccountConfigImport, params);
};

//获取导入数据文件模板
export const requestAccountConfigTemplateFile = (params = {}) => {
//,记得是download方法， md，使用post搞了半天
return http.download(ApiAccountConfigImportTemplateFile, {});
};

//导出数据
export const requestAccountConfigExport = (params: ReqSearch) => {
return http.download(ApiAccountConfigExport, params);
};
